﻿using ASmile.Extern.Lib.Rsp;
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ASmile.Extern.Lib.Test
{
    public class TestSerialResponse : HttpResponseSerial
    {
        public override string Type => "t003";

        protected override void InitSerial(SerialPort serialObj)
        {
            serialObj.BaudRate = 19200;
            serialObj.PortName = "COM1";
        }

        protected override void DataReceived(byte[] data, int offset, int count)
        {
            var str = Encoding.UTF8.GetString(data, offset, count);
            SetData("TEST-Serial", str);
        }
    }
}